package cn.itcast.ks.mapper;


import cn.itcast.ks.pojo.dtos.UserDto;
import cn.itcast.ks.pojo.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author mmff
 * @since 2021-05-03
 */
@Repository
public interface UserMapper extends BaseMapper<User> {
//    @Select("SELECT sum(integral) from `user` where role_id=2 GROUP BY group_id;")
//    Integer[] getGroupsIntegrl();
//    @Select("SELECT group_id from `user` where role_id=2 GROUP BY group_id;")
//    Integer[] getGroupIds();


    @Select("select sum(integral) from user where group_id = #{groupId}")
    public Integer findByClassId(Integer groupId);
}
